/**
 * Tactical Level Manager 
 * Uses for generating maps and for spawn x-com and alien pawns
 */
class xT_LevelManager extends Actor notplaceable;// dependson(X_COM_System_Pawn_Data);

//=============================================================================
// Variables
//=============================================================================
var private xT_Factory_Humans						    FactoryHumans;
var private xT_Factory_Aliens							FactoryAliens;
var private MaterialInstanceConstant                    FogMaterial; 
//var private LightFunction                               FogLightFunction;
//var private DominantDirectionalLightComponent           SunLights;

//=============================================================================
// Functions
//=============================================================================
event PreBeginPlay()
{
	Super.PreBeginPlay();

	FactoryHumans = Spawn(class'xT_Factory_Humans');
	FactoryAliens = Spawn(class'xT_Factory_Aliens');
	AddHumanUnits();
	AddAliens();
	//SetupFogOfWar();
}


function AddHumanUnits()
{
	FactoryHumans.AddHumans();
}

function AddAliens()
{
	//FactoryAliens.AddAliens();
}
/*
function SetupFogOfWar()
{
	local DominantDirectionalLightMovable lMainLight;
	local DirectionalLight lSubLight;
	local DirectionalLight lTmpLight;
	local LightFunction lFogLightFunction;

	foreach AllActors( class 'DirectionalLight', lTmpLight )
	{
		if (lTmpLight.Tag == 'DominantDirectionalLightMovable') lMainLight = DominantDirectionalLightMovable(lTmpLight);
		if (lTmpLight.Tag == 'DirectionalLight') lSubLight = lTmpLight;		
	}
	if ((lMainLight == none) || (lSubLight == none)) `warn("ERROR: One or more DirectionalLights not found in map!");

	FogMaterial = new()Class'MaterialInstanceConstant';
	FogMaterial.SetParent(lMainLight.LightComponent.Function.SourceMaterial);

	lFogLightFunction = new()class'LightFunction';
	lFogLightFunction.SourceMaterial = FogMaterial;
	lFogLightFunction.Scale = lMainLight.LightComponent.Function.Scale;

	lMainLight.LightComponent.SetLightProperties( , , lFogLightFunction);
	lSubLight.LightComponent.SetLightProperties( , , lFogLightFunction);
}

function UpdateFog(ScriptedTexture aMaskTexture)
{
	FogMaterial.SetTextureParameterValue('FogMask', aMaskTexture);
}
*/

//=============================================================================
// Default Properties
//=============================================================================
DefaultProperties
{
}